/* 基础样式与重置 */
@font-face {
    font-family: 'mplus_hzk_12';
    src: url('fonts/mplus_hzk_12.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'mplus_hzk_12', 'Press Start 2P', cursive;
}

body {
    background-color: #0a0a0a;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 游戏容器 */
#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    border: 4px solid #333;
    background-color: #1a1a1a;
    overflow: hidden;
}

/* 屏幕通用样式 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    transition: opacity 0.5s ease;
}

.hidden {
    display: none;
}

/* 像素风格标题 */
.pixel-title {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
    color: #3b82f6;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 2px;
    font-weight: normal;
}

/* 返回按钮样式 */
.back-btn {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.6rem 1rem;
    background-color: #333;
    border: 2px solid #555;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background-color: #555;
    border-color: #3b82f6;
}

/* 关于按钮样式 */
.about-btn {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.6rem 1.2rem;
    background-color: #333;
    border: 2px solid #555;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.about-btn:hover {
    background-color: #555;
    border-color: #3b82f6;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #1a1a1a;
    border: 4px solid #333;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.modal-header {
    padding: 1rem;
    border-bottom: 2px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #3b82f6;
    font-size: 1.2rem;
    margin: 0;
}

.close-btn {
    background-color: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #3b82f6;
}

.modal-body {
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.modal-body p {
    margin-bottom: 0.8rem;
}

/* 章节选择界面样式 */
.chapter-list {
    width: 100%;
    max-width: 600px;
    height: 450px;
    margin: 1rem auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    padding: 0 10px;
}

/* 自定义滚动条 */
.chapter-list::-webkit-scrollbar {
    width: 8px;
}

.chapter-list::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

.chapter-list::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.chapter-list::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

.chapter-item {
    background-color: #2a2a2a;
    padding: 1.5rem;
    border: 2px solid #555;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chapter-item.available {
    border-color: #3b82f6;
}

.chapter-item.available:hover {
    transform: scale(1.02);
    background-color: #333;
}

.chapter-item.locked {
    opacity: 0.7;
    cursor: not-allowed;
    border-color: #444;
}

.chapter-item .lock-icon {
    display: inline-block;
    margin-left: 0.5rem;
    color: #555;
}

.chapter-item h2 {
    color: #93c5fd;
    margin-bottom: 0.5rem;
}

.chapter-item p {
    color: #999;
}

/* 开始界面样式 */
.start-options {
    max-width: 400px;
    margin: 0 auto;
    background-color: #2a2a2a;
    padding: 2rem;
    border: 2px solid #555;
    border-radius: 8px;
}

.name-input {
    margin-bottom: 1.5rem;
}

.name-input label {
    display: block;
    margin-bottom: 0.5rem;
    color: #93c5fd;
}

.name-input input {
    width: 100%;
    padding: 0.8rem;
    background-color: #1a1a1a;
    border: 2px solid #555;
    color: #fff;
    font-size: 1rem;
    border-radius: 4px;
}

.gender-selection {
    margin-bottom: 1.5rem;
}

.gender-selection p {
    margin-bottom: 0.5rem;
    color: #93c5fd;
}

.gender-options {
    display: flex;
    gap: 1rem;
}

.gender-btn {
    flex: 1;
    padding: 0.8rem;
    background-color: #333;
    border: 2px solid #555;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gender-btn:hover {
    background-color: #555;
}

.gender-btn.selected {
    background-color: #3b82f6;
    border-color: #1e3a8a;
}

.start-btn {
    width: 100%;
    padding: 1rem;
    background-color: #3b82f6;
    border: none;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.start-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
}

.start-btn:hover:not(:disabled) {
    background-color: #1e3a8a;
    transform: scale(1.05);
}

.game-description {
    margin-top: 2rem;
    text-align: center;
    color: #999;
    line-height: 1.6;
}

/* 特殊性别弹窗样式 */
.special-gender-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.special-gender-content {
    background-color: #2a2a2a;
    border: 2px solid #555;
    border-radius: 8px;
    padding: 2rem;
    max-width: 400px;
    text-align: center;
}

.special-gender-title {
    color: #3b82f6;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0 #000;
}

.special-gender-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.special-gender-btn {
    padding: 0.8rem;
    background-color: #333;
    border: 2px solid #555;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.special-gender-btn:hover {
    background-color: #555;
    border-color: #3b82f6;
}

.special-gender-btn.selected {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.special-gender-close {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: #555;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.special-gender-close:hover {
    background-color: #777;
}

/* 结算界面样式 */
.result-info {
    max-width: 400px;
    margin: 2rem auto;
    background-color: #2a2a2a;
    padding: 1.5rem;
    border: 2px solid #555;
    border-radius: 8px;
    text-align: center;
}

.result-info p {
    margin-bottom: 1rem;
    color: #93c5fd;
    font-size: 1.2rem;
}

.result-info span {
    color: #fff;
}

.result-actions {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 游戏界面样式 */
#game-header {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background-color: #222;
    border-bottom: 2px solid #444;
}

#game-container-inner {
    display: flex;
    height: calc(100% - 180px);
}

#game-map {
    flex: 3;
    background-color: #111;
    position: relative;
    overflow: hidden;
}

#game-inventory {
    flex: 1;
    background-color: #222;
    border-left: 2px solid #444;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
}

.inventory-title {
    color: #93c5fd;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
}

#inventory-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
}

.inventory-item {
    background-color: #333;
    padding: 0.5rem;
    border: 1px solid #555;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inventory-item:hover {
    background-color: #444;
    border-color: #3b82f6;
}

.inventory-empty {
    color: #777;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* 确保物品栏文字与像素风格一致 */
.inventory-title,
.inventory-item-name,
.inventory-empty {
    font-family: 'mplus_hzk_12', monospace;
    letter-spacing: 0;
}

/* 物品栏动画效果 */
.inventory-item {
    transition: all 0.2s ease;
    transform: scale(1);
}

.inventory-item:hover {
    transform: scale(1.03);
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
}

.inventory-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.inventory-item-name {
    flex: 1;
}

/* 自定义滚动条 */
#inventory-items::-webkit-scrollbar {
    width: 8px;
}

#inventory-items::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

#inventory-items::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

#inventory-items::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

#game-dialogue {
    height: 120px;
    background-color: #222;
    border-top: 2px solid #444;
    padding: 1rem;
}

#dialogue-text {
    margin-bottom: 1rem;
    color: #ddd;
}

#dialogue-choices {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.choice-btn {
    padding: 0.5rem 1rem;
    background-color: #333;
    border: 1px solid #555;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}

.choice-btn:hover {
    background-color: #555;
}

/* 死亡界面样式 */
#death-screen {
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.death-title {
    font-size: 2.5rem;
    color: #3b82f6;
    margin-bottom: 2rem;
    text-shadow: 4px 4px 0 #000;
}

#death-message {
    font-size: 1.2rem;
    color: #93c5fd;
    margin-bottom: 2rem;
    text-align: center;
    max-width: 500px;
}

.restart-btn {
    padding: 1rem 2rem;
    background-color: #3b82f6;
    border: none;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    background-color: #1e3a8a;
    transform: scale(1.05);
}

/* 像素化效果 */
.pixel-title,
.death-title {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.pixel-map {
    font-family: 'Courier New', Courier, monospace;
    color: #fff;
    line-height: 1;
    white-space: pre;
    font-size: 12px;
    letter-spacing: 0;
}

/* 隐藏屏幕 */
.hidden {
    display: none;
}

/* QTE快速点击按钮样式 */
.big-button {
    padding: 2.5rem 5rem;
    background-color: #333;
    border: 3px solid #555;
    color: #fff;
    font-family: 'mplus_hzk_12', monospace;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.1s ease;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    min-width: 300px;
    text-align: center;
}

.big-button:hover {
    background-color: #555;
    border-color: #3b82f6;
}

.big-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* 动画效果 */
@keyframes flicker {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.flicker {
    animation: flicker 0.5s infinite;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s infinite;
}

/* QTE界面样式 */
.qte-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.qte-instructions {
    color: #3b82f6;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 2px 2px 0 #000;
}

.timer-bar-container {
    width: 300px;
    height: 20px;
    background-color: #333;
    border: 2px solid #555;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    background-color: #3b82f6;
    width: 100%;
    transition: width 0.1s linear;
}

.click-count {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}